# user_interface.py
from services import ATMService
from repository import UserRepository

class UserInterface:
    def __init__(self):
        self.repository = UserRepository()
        self.service = ATMService(self.repository)

    def show_menu(self):
        print("欢迎使用银行自助服务系统")
        while True:
            print("1. 查询余额")
            print("2. 退出")
            choice = input("请选择操作：")
            if choice == "1":
                self.handle_search_account()
            elif choice.upper() == "2":
                print("退出系统！")
                break

    def handle_search_account(self):
        card_id = input("请输入您的卡号: ")
        password = input("请输入密码: ")
        print(self.service.search_user(card_id, password))
